/*
 *      Created on: March 9, 2011
 *      Author: topcoder
 */
#include <Length.h>
const unsigned int factor = 1760;

Length::Length(float length, LengthType lengthType):length_m(length),lengthType_m(lengthType)
{
}

bool Length::operator == (const Length &length)const
{
     return (convertToYard(*this) == convertToYard(length));
}

float Length::convertToYard(const Length &length)const
{
   return ((length.lengthType_m == mile)?(length.length_m * factor):(length.length_m));
}


